from rest_framework import serializers

from areas.models import Areas


class AreaSerializer(serializers.ModelSerializer):
    class Meta:
        model = Areas
        fields = ['id', 'name']


class SubAreaSerializer(serializers.ModelSerializer):
    subs = AreaSerializer(read_only=True,many=True)
    class Meta:
        model = Areas
        fields = ['id', 'name', 'subs']

